/*******************************************************************************
 * Copyright (c) 2012 Philip Douglas.
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 ******************************************************************************/
package net.pdouglas.revision;

public class TimeFormatter {
    private int mMinutes;
    private long mRaw;

    public TimeFormatter(long seconds) {
        mRaw = seconds;
        mMinutes = (int)(mRaw / 60);
    }

    @Override
    public String toString() {
        String out = "" ;
        int mins = mMinutes;
        if (mins < 0) {
        	out += "-";
        	mins = -mins;
        }
        
        int hours = mins / 60;
        int minutes = mins % 60;
        //out += (hours < 10 ? "0" : "");
        out += hours + ":";
        out += (minutes < 10 ? "0" : "");
        out += minutes;
        return out;
    }
}
